package com.qd.common.panda.domain.entity.wallet.user;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 用户钱包充值记录
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class UserWalletRechargeLogDTO extends BaseQuery {

    @ExcelIgnore
    @JsonIgnore
    private static final String EXCEL_TITLE = "用户钱包充值记录";

    /**
     * 主键
     */
    @ExcelProperty(value = {EXCEL_TITLE, "订单ID"})
    @NotBlank(message = "订单ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "订单ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String orderId;
    /**
     * 总金额
     */
    @ExcelProperty(value = {EXCEL_TITLE, "订单总金额"})
    @NotNull(message = "总金额不能为空", groups = DefaultGroup.class)
    private BigDecimal allAmount;
    /**
     * 实际支付金额
     */
    @ExcelProperty(value = {EXCEL_TITLE, "支付金额"})
    @NotNull(message = "实际支付金额不能为空", groups = DefaultGroup.class)
    private BigDecimal payAmount;
    /**
     * 赠送金额
     */
    @ExcelProperty(value = {EXCEL_TITLE, "支付金额"})
    private BigDecimal giveAmount;
    /**
     * 充值时间
     */
    @ExcelProperty(value = {EXCEL_TITLE, "充值时间"})
    private LocalDateTime rechargeTime;
    /**
     * 支付状态:0未支付1支付成功2支付失败3已支付4取消支付
     */
    @ExcelIgnore
    private Integer payStatus;
    /**
     * 支付状态,数组
     */
    @ExcelIgnore
    private Object[] payStatusArray;
    /**
     * 支付状态显示
     */
    @ExcelIgnore
    private String payStatusDisplay;
    /**
     * 充值类型:1用户自主充值2后台充值
     */
    @ExcelIgnore
    private Integer rechargeType;
    /**
     * 充值类型显示
     */
    @ExcelIgnore
    private String rechargeTypeDisplay;
    /**
     * 用户ID
     */
    @ExcelProperty(value = {EXCEL_TITLE, "用户ID"})
    @NotBlank(message = "用户ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "用户ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String userId;
    /**
     * 用户手机号
     */
    @ExcelProperty(value = {EXCEL_TITLE, "用户手机号"})
    private String mobile;
    /**
     * 套餐编码
     */
    @ExcelIgnore
    @NotBlank(message = "套餐编码不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "套餐编码长度不能超过{max}位", groups = DefaultGroup.class)
    private String planCode;
    /**
     * 套餐编码显示
     */
    @ExcelProperty(value = {EXCEL_TITLE, "套餐名称"})
    @ExcelIgnore
    private String planCodeDisplay;
    /**
     * 操作人
     */
    @ExcelIgnore
    @Size(max = 50, message = "操作人长度不能超过{max}位", groups = DefaultGroup.class)
    private String operator;
    /**
     * 操作人显示
     */
    @ExcelIgnore
    private String operatorDisplay;
    /**
     * 操作组织
     */
    @ExcelIgnore
    @Size(max = 50, message = "操作组织长度不能超过{max}位", groups = DefaultGroup.class)
    private String operateOrgId;
    /**
     * 操作组织显示
     */
    @ExcelIgnore
    private String operateOrgIdDisplay;
    /**
     * 套餐发布ID
     */
    @ExcelIgnore
    @NotBlank(message = "套餐发布ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "套餐发布ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String publishId;
    /**
     * 套餐发布ID显示
     */
    @ExcelIgnore
    private String publishIdDisplay;

    @Override
    public void freeData() {
        this.orderId = null;
        this.allAmount = null;
        this.giveAmount = null;
        this.payAmount = null;
        this.rechargeTime = null;
        this.payStatus = null;
        this.payStatusDisplay = null;
        this.rechargeType = null;
        this.rechargeTypeDisplay = null;
        this.userId = null;
        this.planCode = null;
        this.planCodeDisplay = null;
        this.operator = null;
        this.operatorDisplay = null;
        this.operateOrgId = null;
        this.operateOrgIdDisplay = null;
        this.publishId = null;
        this.publishIdDisplay = null;
        this.payStatusArray = null;
        this.mobile = null;
        super.freeData();
    }
}
